from Page.page_application import Application
from Page.page_login import Login
from Tools.tools import DriverTools
from config import BASE_URL
from script import log


class TestApplication:
    def setup_method(self):
        driver = DriverTools.get_driver()
        driver.get(BASE_URL + "/common/member/login")
        self.login = Login(driver)
        self.login.login_succeses("18738142070", "test123456")
        self.aplay = Application(driver)

    def teardown_method(self):
        DriverTools.close_driver()

    def test01_application_success(self):
        self.aplay.application("1000", "test", "8888")
        result = self.aplay.success_assert()
        log.info(f"执行结果{result}")
        assert '1,000.00' in result
        self.aplay.get_shot("application_success.png")

    # def test02_application_fail(self):
    #     self.login.login_succeses("18738142070", "test123456")
    #     self.aplay.application("10000", "test", "8888")
